home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
451-475
/
disk_455
/
anguscopy
/
anguscopy2.0.mod
< prev
next >
Wrap
Text File
|
1992-05-06
|
25KB
|
838 lines
(*
Program: AngusCopy 2.0
Release: 2.0 2-Feb-91 20.00
Copyright: © Copyright 1991 by Andreas Gunßer
Author: Andreas Gunßer
Address: Großheppacherstr. 34 D-7056 Weinstadt-Endersbach Germany
Phone: 07151/61846
Use: Copy a Disk in 1:34 minutes
Language: Modula-2
History: 1.0 (28-Jan-91)
History: 2.0 ( 2-Feb-91)
History:
Greetings: Alle Modula-2 Programmierer
Alle PD-Fans
Roni,Andi,Günther,Dani,Jutta,Biggi,Kitty,Pet Shop Boys
Thanks to: The author of TrackDiskSupport -- great work !!
*)
MODULE AngusCopy;
FROM SYSTEM IMPORT ADR;
FROM Intuition IMPORT NewWindow,WindowPtr,IDCMPFlags,IDCMPFlagSet,
WindowFlags,WindowFlagSet,OpenWindow,CloseWindow,
IntuiMessage,IntuiText,Gadget,boolGadget,
GadgetFlags,GadgetFlagSet,ActivationFlags,
ActivationFlagSet,Border,ScreenFlagSet,
ScreenFlags,StringInfo,strGadget;
FROM Exec IMPORT Byte,GetMsg,ReplyMsg,WaitPort;
FROM Heap IMPORT AllocMem,Deallocate;
FROM Graphics IMPORT jam1,Move,Text,RastPortPtr,SetAPen;
FROM Arts IMPORT Assert;
FROM Strings IMPORT Length;
FROM Conversions IMPORT ValToStr;
FROM TrackDiskSupport IMPORT OpenTrackDisk,CloseTrackDisk,GetDiskChange,
FormatTrack,ReadCycSec;
FROM TrackDisk IMPORT notSpecified,noSecHdr,badSecPreamble,badSecId,
badHdrSum,badSecSum,tooFewSecs,badSecHdr,writeProt,
diskChanged,seekError,noMem,badUnitNum,
badDriveType,driveInUse,postReset;
CONST
s0gad = 0;
s1gad = 1;
s2gad = 2;
s3gad = 3;
d0gad = 4;
d1gad = 5;
d2gad = 6;
d3gad = 7;
strackgad = 8;
etrackgad = 9;
startgad = 10;
aboutgad = 11;
TrackSize = 512*22;
VAR
Fenster : NewWindow;
FensterPtr : WindowPtr;
FensterTitle : ARRAY [0..70] OF CHAR;
FRPort : RastPortPtr;
class : IDCMPFlagSet;
IntuiMsg : POINTER TO IntuiMessage;
sGadget : Gadget;
sGadgetRahmen : Border;
sGadgetText : IntuiText;
sXYFeld : ARRAY [0..9] OF INTEGER;
aGadget : Gadget;
aGadgetRahmen : Border;
aGadgetText : IntuiText;
aXYFeld : ARRAY [0..9] OF INTEGER;
sTrGadget : Gadget;
sTrGadgetRahmen : Border;
sTrXYFeld : ARRAY [0..9] OF INTEGER;
sTrInfo : StringInfo;
sTrBuffer : ARRAY [0..80] OF CHAR;
sTrUndoBuffer : ARRAY [0..80] OF CHAR;
eTrGadget : Gadget;
eTrGadgetRahmen : Border;
eTrXYFeld : ARRAY [0..9] OF INTEGER;
eTrInfo : StringInfo;
eTrBuffer : ARRAY [0..80] OF CHAR;
eTrUndoBuffer : ARRAY [0..80] OF CHAR;
dGadget : ARRAY [1..8] OF Gadget;
dGadgetRahmen : ARRAY [1..8] OF Border;
dGadgetText : ARRAY [1..8] OF IntuiText;
dGadgetNo : ARRAY [1..8],[0..1] OF CHAR;
dXYFeld : ARRAY [0..9] OF INTEGER;
null,eins,zwei,drei : CHAR;
whichGadget : POINTER TO Gadget;
quelle,ziel : CARDINAL;
sTrack,eTrack : CARDINAL;
TrackBuffer : POINTER TO ARRAY [0..TrackSize-1] OF CHAR;
gadgzahl : CARDINAL;
z1 : INTEGER; (* counter *)
PROCEDURE About;
VAR
aFenster : NewWindow;
aFensterPtr : WindowPtr;
aFensterTitle : ARRAY [0..70] OF CHAR;
aFRPort : RastPortPtr;
aclass : IDCMPFlagSet;
aIntuiMsg : POINTER TO IntuiMessage;
BEGIN (* About *)
aFensterTitle := "About AngusCopy 2.0";
WITH aFenster DO
leftEdge := 160;
topEdge := 30;
width := 330;
height := 180;
detailPen := 0;
blockPen := 1;
idcmpFlags := IDCMPFlagSet {closeWindow};
flags := WindowFlagSet {windowDrag,windowDepth,windowClose,
activate};
firstGadget := NIL;
checkMark := NIL;
title := ADR (aFensterTitle);
type := ScreenFlagSet {wbenchScreen};
END (* WITH *);
aFensterPtr := OpenWindow (aFenster);
Assert (aFensterPtr # NIL,ADR ("Can`t open AboutWindow"));
aFRPort := aFensterPtr^.rPort;
SetAPen (aFRPort,1);
Move (aFRPort,108,20);
Text (aFRPort,ADR("AngusCopy 2.0"),13);
Move (aFRPort,24,45);
Text (aFRPort,ADR("© Copyright 1991 by Andreas Gunßer"),34);
Move (aFRPort,92,58);
Text (aFRPort,ADR("This is ShareWare"),17);
Move (aFRPort,72,71);
Text (aFRPort,ADR("Send 10 U$ or 15 DM to"),22);
Move (aFRPort,104,91);
Text (aFRPort,ADR("Andreas Gunßer"),14);
Move (aFRPort,80,104);
Text (aFRPort,ADR("Großheppacherstr. 34"),20);
Move (aFRPort,52,117);
Text (aFRPort,ADR("D-7056 Weinstadt-Endersbach"),27);
Move (aFRPort,132,130);
Text (aFRPort,ADR("Germany"),7);
Move (aFRPort,124,150);
Text (aFRPort,ADR("Thanks to"),9);
Move (aFRPort,40,163);
Text (aFRPort,ADR("The Author of TrackDiskSupport"),30);
LOOP
WaitPort (aFensterPtr^.userPort);
aIntuiMsg := GetMsg (aFensterPtr^.userPort);
WHILE (aIntuiMsg # NIL) DO
aclass := aIntuiMsg^.class;
ReplyMsg (aIntuiMsg);
IF (closeWindow IN aclass) THEN
EXIT;
END;
aIntuiMsg := GetMsg (aFensterPtr^.userPort);
END (* WHILE *);
END (* LOOP *);
CloseWindow (aFensterPtr);
END About;
PROCEDURE cError (ceFensterTitle:ARRAY OF CHAR;whaterr:Byte;
where:INTEGER):BOOLEAN;
CONST
cancelgad = 0;
skipgad = 1;
VAR
ceFenster : NewWindow;
ceFensterPtr : WindowPtr;
ceFrPort : RastPortPtr;
ceclass : IDCMPFlagSet;
ceIntuiMsg : POINTER TO IntuiMessage;
ceGadget : ARRAY [0..1] OF Gadget;
ceRahmen : ARRAY [0..1] OF Border;
ceXYFeld : ARRAY [0..9] OF INTEGER;
ceText : ARRAY [0..1] OF IntuiText;
cancelText : ARRAY [0..50] OF CHAR;
skipText : ARRAY [0..50] OF CHAR;
gadgets : CARDINAL;
errorString : ARRAY [0..50] OF CHAR;
ceiGadget : POINTER TO Gadget;
whereString : ARRAY [0..10] OF CHAR;
dummyb : BOOLEAN;
BEGIN (* cError *)
WITH ceFenster DO
leftEdge := 170;
topEdge := 70;
width := 300;
height := 116;
detailPen := 0;
blockPen := 1;
idcmpFlags := IDCMPFlagSet {gadgetUp};
flags := WindowFlagSet {windowDrag,windowDepth,activate};
firstGadget := ADR (ceGadget[0]);
checkMark := NIL;
title := ADR (ceFensterTitle);
bitMap := NIL;
type := ScreenFlagSet {wbenchScreen};
END (* WITH *);
ceXYFeld[0] := 0;
ceXYFeld[1] := 0;
ceXYFeld[2] := 121;
ceXYFeld[3] := 0;
ceXYFeld[4] := 121;
ceXYFeld[5] := 11;
ceXYFeld[6] := 0;
ceXYFeld[7] := 11;
ceXYFeld[8] := 0;
ceXYFeld[9] := 0;
FOR gadgets := 0 TO 1 DO
WITH ceRahmen[gadgets] DO
leftEdge := -1;
topEdge := -1;
frontPen := 1;
backPen := 0;
drawMode := jam1;
count := 5;
xy := ADR (ceXYFeld);
nextBorder:= NIL;
END (* WITH *);
WITH ceText[gadgets] DO
frontPen := 1;
backPen := 0;
topEdge := 2;
drawMode := jam1;
nextText := NIL;
END (* WITH *);
ceText[0].leftEdge := 16;
ceText[0].iText := ADR ("Cancel Copy");
ceText[1].leftEdge := 20;
ceText[1].iText := ADR ("Skip Track");
WITH ceGadget[gadgets] DO
topEdge := 90;
width := 120;
height := 10;
flags := GadgetFlagSet {};
activation := ActivationFlagSet {gadgImmediate,relVerify};
gadgetType := boolGadget;
gadgetRender := ADR (ceRahmen[gadgets]);
selectRender := NIL;
gadgetText := ADR (ceText[gadgets]);
specialInfo := NIL;
userData := NIL;
END (* WITH *);
END (* FOR *);
ceGadget[0].nextGadget := ADR (ceGadget[1]);
ceGadget[0].leftEdge := 20;
ceGadget[0].gadgetID := cancelgad;
ceGadget[1].nextGadget := NIL;
ceGadget[1].leftEdge := 160;
ceGadget[1].gadgetID := skipgad;
ceFensterPtr := OpenWindow (ceFenster);
Assert (ceFensterPtr # NIL,ADR ("Can`t open a Window !"));
ceFrPort := ceFensterPtr^.rPort;
CASE whaterr OF
notSpecified: errorString := "Not specified Error";|
noSecHdr: errorString := "No Sector Header";|
badSecPreamble: errorString := "Bad Sector Preamble";|
badSecId: errorString := "Bad Sector Identifier";|
badHdrSum: errorString := "Header-Checksum Error";|
badSecSum: errorString := "Sector-Checksum Error";|
tooFewSecs: errorString := "Too few Sectors";|
badSecHdr: errorString := "Bad Sector Header";|
writeProt: errorString := "Disk write-protected";|
diskChanged: errorString := "No Disk in Drive";|
seekError: errorString := "Seek Error";|
noMem: errorString := "Not enough memory";|
badUnitNum: errorString := "Drive not connected";|
badDriveType: errorString := "Bad Drive-Type";|
driveInUse: errorString := "Drive in use";|
postReset: errorString := "User Reset";|
ELSE
errorString := "Unknown Error";
END (* CASE *);
ValToStr (where,TRUE,whereString,10,+2," ",dummyb);
Move (ceFrPort,20,20);
Text (ceFrPort,ADR ("Track:"),6);
Move (ceFrPort,20,35);
Text (ceFrPort,ADR ("Error:"),6);
Move (ceFrPort,76,20);
Text (ceFrPort,ADR (whereString),Length(whereString));
Move (ceFrPort,76,35);
Text (ceFrPort,ADR (errorString),Length (errorString));
LOOP
WaitPort (ceFensterPtr^.userPort);
ceIntuiMsg := GetMsg (ceFensterPtr^.userPort);
WHILE (ceIntuiMsg # NIL) DO
ceclass := ceIntuiMsg^.class;
ceiGadget:= ceIntuiMsg^.iAddress;
ReplyMsg (ceIntuiMsg);
IF (gadgetUp IN class) THEN
IF (ceiGadget^.gadgetID = cancelgad) THEN
CloseWindow (ceFensterPtr);
RETURN FALSE;
ELSIF (ceiGadget^.gadgetID = skipgad) THEN
CloseWindow (ceFensterPtr);
RETURN TRUE;
END (* IF *);
END (* IF *);
ceIntuiMsg := GetMsg (ceFensterPtr^.userPort);
END (* WHILE *);
END (* LOOP *);
END cError;
PROCEDURE OpenError (fRow:ARRAY OF CHAR;sRow:ARRAY OF CHAR);
VAR
oeFenster : NewWindow;
oeFensterPtr : WindowPtr;
oeFensterTitle : ARRAY [0..70] OF CHAR;
oeFrPort : RastPortPtr;
oeclass : IDCMPFlagSet;
oeIntuiMsg : POINTER TO IntuiMessage;
BEGIN (* OpenError *)
oeFensterTitle := "Fatal Error !";
WITH oeFenster DO
leftEdge := 170;
topEdge := 100;
width := 300;
height := 50;
detailPen := 0;
blockPen := 1;
idcmpFlags := IDCMPFlagSet {closeWindow};
flags := WindowFlagSet {windowDrag,windowClose,windowDepth,activate};
firstGadget := NIL;
checkMark := NIL;
title := ADR (oeFensterTitle);
bitMap := NIL;
type := ScreenFlagSet {wbenchScreen};
END (* WITH *);
oeFensterPtr := OpenWindow (oeFenster);
Assert (oeFensterPtr # NIL,ADR ("Can`t open a Window !"));
oeFrPort := oeFensterPtr^.rPort;
Move (oeFrPort,20,20);
Text (oeFrPort,ADR (fRow),Length (fRow));
Move (oeFrPort,20,32);
Text (oeFrPort,ADR (sRow),Length (sRow));
LOOP
WaitPort (oeFensterPtr^.userPort);
oeIntuiMsg := GetMsg (oeFensterPtr^.userPort);
WHILE (oeIntuiMsg # NIL) DO
oeclass := oeIntuiMsg^.class;
ReplyMsg (oeIntuiMsg);
IF (closeWindow IN oeclass) THEN
EXIT;
END (* IF *);
oeIntuiMsg := GetMsg (oeFensterPtr^.userPort);
END (* WHILE *);
END (* LOOP *);
CloseWindow (oeFensterPtr);
END OpenError;
PROCEDURE TrackCopy (track:CARDINAL;from:CARDINAL;to:CARDINAL):BOOLEAN;
VAR
error : Byte;
fehlerbool : BOOLEAN;
BEGIN (* TrackCopy *)
(* Read the Track *)
error := ReadCycSec (from,track,0,0,TrackBuffer,22,GetDiskChange(from));
IF (error # 0) THEN
fehlerbool := cError ("Error on Sourcedrive",error,track);
(* Skip Track:.... *)
IF (fehlerbool = TRUE) THEN
RETURN TRUE;
(* Cancel Backup:... *)
ELSIF (fehlerbool = FALSE) THEN
RETURN FALSE;
END (* IF *);
END (* IF *);
(* Write the Track *)
error := FormatTrack (to,track,TrackBuffer,1,GetDiskChange(to));
IF (error # 0) THEN
fehlerbool := cError ("Error on Desinationdrive",error,track);
(* Skip Track *)
IF (fehlerbool = TRUE) THEN
RETURN TRUE;
(* Cancel Backup:... *)
ELSIF (fehlerbool = FALSE) THEN
RETURN FALSE;
END (* IF *);
END (* IF *);
RETURN TRUE;
END TrackCopy;
PROCEDURE DiskCopy (source:CARDINAL;desti:CARDINAL;sTr:CARDINAL;eTr:CARDINAL);
VAR
err1,err2 : Byte;
tracks : INTEGER;
bool : BOOLEAN;
BEGIN (* DiskCopy *);
IF (sTr > eTr) THEN
OpenError ("Your Starttrack is higher than","your Endtrack");
RETURN;
END (* IF *);
IF ((sTr < 0) OR (sTr > 79)) THEN
OpenError ("Your Starttrack is out of range","x >= 0 <= 79");
RETURN;
END (* IF *);
IF ((eTr < 0) OR (eTr > 79)) THEN
OpenError ("Your Endtrack is out of range","x >= 0 <= 79");
RETURN;
END (* IF *);
IF (source = desti) THEN
OpenError ("Your Sourcedrive is the same","as your Destinationdrive");
RETURN;
END (* IF *);
err1 := OpenTrackDisk (source,TRUE);
IF (err1 # 0) THEN
OpenError ("There is s.th. wrong with","your Sourcedrive");
RETURN;
END (* IF *);
err2 := OpenTrackDisk (desti,TRUE);
IF (err2 # 0) THEN
OpenError ("There is s.th wrong with","your Destinationdrive");
CloseTrackDisk (source);
RETURN;
END (* IF *);
AllocMem (TrackBuffer,SIZE(TrackBuffer^),TRUE);
(*------ Copy ---------------------------------------------*)
LOOP
FOR tracks := sTr TO eTr DO
bool := TrackCopy (tracks,source,desti);
IF (bool = FALSE) THEN
EXIT (* LOOP *);
END (* IF *);
END (* FOR *);
EXIT (* LOOP *);
END (* LOOP *);
CloseTrackDisk (source);
CloseTrackDisk (desti);
Deallocate (TrackBuffer);
END DiskCopy;
(* ------- ab hier geht`s so richtig los ------------------------------- *)
BEGIN (* main program *)
quelle := 0;
ziel := 1;
sTrack := 0;
eTrack := 79;
null := "0";
eins := "1";
zwei := "2";
drei := "3";
dGadgetNo[1,0] := "0";
dGadgetNo[2,0] := "1";
dGadgetNo[3,0] := "2";
dGadgetNo[4,0] := "3";
dGadgetNo[5,0] := "0";
dGadgetNo[6,0] := "1";
dGadgetNo[7,0] := "2";
dGadgetNo[8,0] := "3";
FensterTitle := "AngusCopy 2.0 by Andreas Gunßer";
WITH Fenster DO
leftEdge := 115;
topEdge := 63;
width := 405;
height := 110;
detailPen:= 0;
blockPen := 1;
idcmpFlags:= IDCMPFlagSet {closeWindow,gadgetUp};
flags := WindowFlagSet {windowDrag,windowDepth,windowClose,activate};
firstGadget := ADR (dGadget[1]);
checkMark := NIL;
title := ADR (FensterTitle);
bitMap := NIL;
type := ScreenFlagSet {wbenchScreen};
END (* WITH *);
(* ------------------- Drive-Gadgets ----------------------------- *)
dXYFeld[0] := 0;
dXYFeld[1] := 0;
dXYFeld[2] := 21;
dXYFeld[3] := 0;
dXYFeld[4] := 21;
dXYFeld[5] := 11;
dXYFeld[6] := 0;
dXYFeld[7] := 11;
dXYFeld[8] := 0;
dXYFeld[9] := 0;
dGadgetText[1].iText := ADR (null);
dGadgetText[2].iText := ADR (eins);
dGadgetText[3].iText := ADR (zwei);
dGadgetText[4].iText := ADR (drei);
dGadgetText[5].iText := ADR (null);
dGadgetText[6].iText := ADR (eins);
dGadgetText[7].iText := ADR (zwei);
dGadgetText[8].iText := ADR (drei);
FOR gadgzahl := 1 TO 8 DO
WITH dGadgetRahmen[gadgzahl] DO
leftEdge := -1;
topEdge := -1;
frontPen := 1;
backPen := 0;
drawMode := jam1;
count := 5;
xy := ADR (dXYFeld);
nextBorder := NIL;
END (* WITH *);
WITH dGadgetText[gadgzahl] DO
frontPen := 1;
backPen := 0;
drawMode := jam1;
leftEdge := 6;
topEdge := 2;
iText := ADR (dGadgetNo[gadgzahl]);
nextText := NIL;
END (* WITH *);
WITH dGadget[gadgzahl] DO
width := 20;
height := 10;
flags := GadgetFlagSet {};
activation := ActivationFlagSet {relVerify};
gadgetType := boolGadget;
gadgetRender := ADR (dGadgetRahmen[gadgzahl]);
selectRender := NIL;
gadgetText := ADR (dGadgetText[gadgzahl]);
specialInfo := NIL;
userData := NIL;
END (* WITH *);
END (* FOR *);
dGadget[1].nextGadget := ADR (dGadget[2]);
dGadget[1].leftEdge := 100;
dGadget[1].topEdge := 30;
dGadget[1].gadgetID := s0gad;
dGadget[2].nextGadget := ADR (dGadget[3]);
dGadget[2].leftEdge := 140;
dGadget[2].topEdge := 30;
dGadget[2].gadgetID := s1gad;
dGadget[3].nextGadget := ADR (dGadget[4]);
dGadget[3].leftEdge := 180;
dGadget[3].topEdge := 30;
dGadget[3].gadgetID := s2gad;
dGadget[4].nextGadget := ADR (dGadget[5]);
dGadget[4].leftEdge := 220;
dGadget[4].topEdge := 30;
dGadget[4].gadgetID := s3gad;
dGadget[5].nextGadget := ADR (dGadget[6]);
dGadget[5].leftEdge := 100;
dGadget[5].topEdge := 50;
dGadget[5].gadgetID := d0gad;
dGadget[6].nextGadget := ADR (dGadget[7]);
dGadget[6].leftEdge := 140;
dGadget[6].topEdge := 50;
dGadget[6].gadgetID := d1gad;
dGadget[7].nextGadget := ADR (dGadget[8]);
dGadget[7].leftEdge := 180;
dGadget[7].topEdge := 50;
dGadget[7].gadgetID := d2gad;
dGadget[8].nextGadget := ADR (sGadget);
dGadget[8].leftEdge := 220;
dGadget[8].topEdge := 50;
dGadget[8].gadgetID := d3gad;
(* --------------- Start & About Gadget ---------------------------- *)
sXYFeld[0] := 0;
sXYFeld[1] := 0;
sXYFeld[2] := 51;
sXYFeld[3] := 0;
sXYFeld[4] := 51;
sXYFeld[5] := 11;
sXYFeld[6] := 0;
sXYFeld[7] := 11;
sXYFeld[8] := 0;
sXYFeld[9] := 0;
WITH sGadgetRahmen DO
leftEdge := -1;
topEdge := -1;
frontPen := 1;
backPen := 0;
drawMode := jam1;
count := 5;
xy := ADR (sXYFeld);
nextBorder := NIL;
END (* WITH *);
WITH sGadgetText DO
frontPen := 1;
backPen := 0;
drawMode := jam1;
leftEdge := 5;
topEdge := 2;
nextText := NIL;
iText := ADR ("Start");
END (* WITH *);
WITH sGadget DO
nextGadget := ADR (aGadget);
leftEdge := 100;
topEdge := 75;
width := 50;
height := 10;
flags := GadgetFlagSet {};
activation := ActivationFlagSet {relVerify};
gadgetType := boolGadget;
gadgetRender := ADR (sGadgetRahmen);
selectRender := NIL;
gadgetText := ADR (sGadgetText);
specialInfo := NIL;
gadgetID := startgad;
userData := NIL;
END (* WITH *);
FOR z1 := 0 TO 9 DO
aXYFeld[z1] := sXYFeld[z1];
END (* FOR *);
aGadgetRahmen := sGadgetRahmen;
aGadgetRahmen.xy := ADR (aXYFeld);
aGadgetText := sGadgetText;
aGadgetText.iText := ADR ("About");
aGadget := sGadget;
WITH aGadget DO
nextGadget := ADR (sTrGadget);
leftEdge := 255;
gadgetRender := ADR (aGadgetRahmen);
gadgetText := ADR (aGadgetText);
gadgetID := aboutgad;
END (* WITH *);
(* ---------- Start & End Track Gadgets --------------------- *)
sTrXYFeld[0] := 0;
sTrXYFeld[1] := 0;
sTrXYFeld[2] := 31;
sTrXYFeld[3] := 0;
sTrXYFeld[4] := 31;
sTrXYFeld[5] := 11;
sTrXYFeld[6] := 0;
sTrXYFeld[7] := 11;
sTrXYFeld[8] := 0;
sTrXYFeld[9] := 0;
WITH sTrGadgetRahmen DO
leftEdge := -1;
topEdge := -3;
frontPen := 1;
backPen := 0;
drawMode := jam1;
count := 5;
xy := ADR (sTrXYFeld);
nextBorder := NIL;
END (* WITH *);
sTrBuffer := "0";
sTrUndoBuffer := "0";
WITH sTrInfo DO
buffer := ADR (sTrBuffer);
undoBuffer := ADR (sTrUndoBuffer);
bufferPos := 0;
maxChars := 3;
dispPos := 0;
END (* WITH *);
WITH sTrGadget DO
nextGadget := ADR (eTrGadget);
leftEdge := 360;
topEdge := 32;
width := 30;
height := 10;
flags := GadgetFlagSet {};
activation := ActivationFlagSet {longint,stringCenter,toggleSelect,
relVerify};
gadgetType := strGadget;
gadgetRender := ADR (sTrGadgetRahmen);
selectRender := NIL;
gadgetText := NIL;
specialInfo := ADR (sTrInfo);
gadgetID := strackgad;
userData := NIL;
END (* WITH *);
FOR z1 := 0 TO 9 DO
eTrXYFeld[z1] := sTrXYFeld[z1];
END (* FOR *);
eTrGadgetRahmen := sTrGadgetRahmen;
eTrGadgetRahmen.xy := ADR (eTrXYFeld);
eTrInfo := sTrInfo;
eTrBuffer := "79";
eTrInfo.buffer := ADR (eTrBuffer);
eTrInfo.undoBuffer := ADR (eTrUndoBuffer);
eTrGadget := sTrGadget;
WITH eTrGadget DO
nextGadget := NIL;
topEdge := 52;
gadgetRender := ADR (eTrGadgetRahmen);
selectRender := NIL;
gadgetText := NIL;
specialInfo := ADR (eTrInfo);
gadgetID := etrackgad;
userData := NIL;
END (* WITH *);
FensterPtr := OpenWindow (Fenster);
Assert (FensterPtr # NIL,ADR ("Can`t open Window !"));
FRPort := FensterPtr^.rPort;
SetAPen (FRPort,1);
Move (FRPort,10,38);
Text (FRPort,ADR ("Source:"),7);
Move (FRPort,10,58);
Text (FRPort,ADR ("Dest.:"),6);
Move (FRPort,265,38);
Text (FRPort,ADR ("Starttrack:"),11);
Move (FRPort,265,58);
Text (FRPort,ADR ("Endtrack:"),9);
Move (FRPort,75,38);
Text (FRPort,ADR (null),1);
Move (FRPort,75,58);
Text (FRPort,ADR (eins),1);
LOOP
WaitPort (FensterPtr^.userPort);
IntuiMsg := GetMsg (FensterPtr^.userPort);
WHILE (IntuiMsg # NIL) DO
class := IntuiMsg^.class;
whichGadget := IntuiMsg^.iAddress;
ReplyMsg (IntuiMsg);
IF (closeWindow IN class) THEN
EXIT;
ELSIF (gadgetUp IN class) THEN
CASE whichGadget^.gadgetID OF
aboutgad : About;|
startgad : Move (FRPort,20,22);
Text (FRPort,ADR ("Copying..."),10);
DiskCopy (quelle,ziel,sTrack,eTrack);
Move (FRPort,20,22);
Text (FRPort,ADR ("Ready "),10);|
s0gad : quelle := 0;
Move (FRPort,75,38);
Text (FRPort,ADR (null),1);|
s1gad : quelle := 1;
Move (FRPort,75,38);
Text (FRPort,ADR (eins),1);|
s2gad : quelle := 2;
Move (FRPort,75,38);
Text (FRPort,ADR (zwei),1);|
s3gad : quelle := 3;
Move (FRPort,75,38);
Text (FRPort,ADR (drei),1);|
d0gad : ziel := 0;
Move (FRPort,75,58);
Text (FRPort,ADR (null),1);|
d1gad : ziel := 1;
Move (FRPort,75,58);
Text (FRPort,ADR (eins),1);|
d2gad : ziel := 2;
Move (FRPort,75,58);
Text (FRPort,ADR (zwei),1);|
d3gad : ziel := 3;
Move (FRPort,75,58);
Text (FRPort,ADR (drei),1);|
strackgad : sTrack := ABS (sTrInfo.longInt);|
etrackgad : eTrack := ABS (eTrInfo.longInt);|
ELSE
END (* CASE *);
END (* IF *);
IntuiMsg := GetMsg (FensterPtr^.userPort);
END (* WHILE *);
END (* LOOP *);
CloseWindow (FensterPtr);
END AngusCopy.